const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

const config = {
  title: '王开琦的博客',
  tagline: 'With today\'s efforts, let tomorrow have no regrets.',
  url: 'https://blog.wkq.pub',
  baseUrl: '/',
  onBrokenLinks: 'throw',
  onBrokenMarkdownLinks: 'throw',
  onDuplicateRoutes: 'throw',
  favicon: 'img/icon.png',

  i18n: {
    defaultLocale: 'zh-Hans',
    locales: ['zh-Hans'],
  },
  presets: [
    [
      'classic',
      ({
        docs: {
          sidebarPath: require.resolve('./sidebars.js'),
        },
        blog: {
          showReadingTime: true,
        },
        theme: {
          customCss: require.resolve('./src/css/custom.css'),
        },
      }),
    ],
  ],
  themeConfig:
    ({
      colorMode: {
        defaultMode: 'light',
        disableSwitch: true,
      },
      docs: {
        sidebar: {
          hideable: true,
          autoCollapseCategories: true,
        },
      },
      navbar: {
        title: '王开琦的博客',
        logo: {
          alt: 'Site Logo',
          src: 'img/icon.png',
        },
        hideOnScroll: true,
        items: [
          // {
          //   type: 'doc',
          //   docId: 'JavaSE/index',
          //   position: 'left',
          //   label: 'JavaSE',
          // },
          // {
          //   type: 'doc',
          //   docId: 'frontEnd/index',
          //   position: 'left',
          //   label: '前端',
          // },
          {
            type: 'doc',
            docId: 'architect/MonomerArchitecture/index',
            label: '单体',
            position: 'left',
          },
          {
            type: 'doc',
            docId: 'architect/ClusterArchitecture/index',
            label: '集群',
            position: 'left',
          },
          {
            type: 'doc',
            docId: 'architect/Distributed/index',
            label: '分布式',
            position: 'left',
          },
          {
            type: 'doc',
            docId: 'architect/Microservices/index',
            label: '微服务',
            position: 'left',
          },
          {
            type: 'doc',
            docId: 'basic/Internet/index',
            label: '网络',
            position: 'left',
          },
          //
          // {
          //   type: 'dropdown',
          //   position: 'left',
          //   label: '架构',
          //   items:[
          //
          //   ]
          // },

          {to: '/blog', label: '随笔', position: 'right'},
          {
            href: 'https://gitee.com/wkqgitee/blog.wkq.pub',
            label: 'gitee',
            position: 'right',
          },
        ],
      },
      footer: {
        style: 'light',
        copyright: `Copyright© ${new Date().getFullYear()}  blog.wkq.pub 陇ICP备2021003596号.`,
      },
      prism: {
        theme: lightCodeTheme,
        darkTheme: darkCodeTheme,
      },
    }),
};

module.exports = config;
